clear all 
log using "/Users/abhram/Library/CloudStorage/Dropbox/Research/trA/replication/table_4.log", replace 	
	
******************************************************************** 
********         TABLE 4:  POOLED GQR                       ********
******************************************************************** 



	use "Duranton_Turner_AER_2010.dta", clear


	* Selection of observations
	drop if l_ln_km_IH_83==0

	rename sprawl_1992 sprawl_1993
	rename sprawl_1976 sprawl_1983
	gen sprawl_2003 = sprawl_1993

	*rescale so display is better
	replace elevat_range_msa = elevat_range_msa/1000 
	replace ruggedness_msa = ruggedness_msa/1000
	replace heating_dd = heating_dd/100
	replace cooling_dd = cooling_dd/100

      rename S_somecollege_80 S_somecollege_1983
      rename S_somecollege_00 S_somecollege_2003
      rename S_somecollege_90 S_somecollege_1993
      rename S_poor_80 S_poor_1983
      rename S_poor_90 S_poor_1993
      rename S_poor_00 S_poor_2003
      rename l_mean_income_80 l_mean_income_1983
      rename l_mean_income_90 l_mean_income_1993
      rename l_mean_income_00 l_mean_income_2003
      rename S_manuf83 S_manuf_1983
      rename S_manuf93 S_manuf_1993
      rename S_manuf03 S_manuf_2003
      rename S_truck83 S_truck_1983
      rename S_truck93 S_truck_1993
      rename S_truck03 S_truck_2003
      gen l_pop_1983 = l_pop80 
      gen l_pop_1993 = l_pop90 
      gen l_pop_2003 = l_pop00 

      rename l_max_84bus l_bus_1983 
      rename l_max_94bus l_bus_1993 
      rename l_max_04bus l_bus_2003 
      rename l_transit84 l_transit_1983
      rename l_transit94 l_transit_1993 
      rename l_transit04 l_transit_2003

      rename l_ln_km_IHU_83 l_ln_km_IHU_1983
      rename l_ln_km_IHU_93 l_ln_km_IHU_1993
      rename l_ln_km_IHU_03 l_ln_km_IHU_2003
      rename l_ln_km_IH_83 l_ln_km_IH_1983
      rename l_ln_km_IH_93 l_ln_km_IH_1993
      rename l_ln_km_IH_03 l_ln_km_IH_2003
      rename l_ln_km_MRU_83 l_ln_km_MRU_1983
      rename l_ln_km_MRU_93 l_ln_km_MRU_1993
      rename l_ln_km_MRU_03 l_ln_km_MRU_2003
      
      rename l_vmt_IHU_83 l_vmt_IHU_1983
      rename l_vmt_IHU_93 l_vmt_IHU_1993
      rename l_vmt_IHU_03 l_vmt_IHU_2003
      rename l_vmt_IH_83 l_vmt_IH_1983
      rename l_vmt_IH_93 l_vmt_IH_1993
      rename l_vmt_IH_03 l_vmt_IH_2003
      rename l_vmt_MRU_83 l_vmt_MRU_1983
      rename l_vmt_MRU_93 l_vmt_MRU_1993
      rename l_vmt_MRU_03 l_vmt_MRU_2003



	reshape long l_ln_km_IH  l_ln_km_IHU  l_ln_km_IHNU  l_ln_km_MRU l_vmt_IH l_vmt_IHU  l_vmt_IHNU  l_vmt_MRU l_bus l_transit sprawl S_somecollege l_mean_income S_poor S_manuf S_truck l_pop, i(msa ) j(year _1983 _1993 _2003)

	local geography	 "elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl"
	local demographics "S_somecollege l_mean_income S_poor S_manuf"  
	local census_div "div1 div2 div3 div4 div5 div6 div7 div8 div9"
	local population "l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20"  


	
* First Panel *	
		
		local Inst "l_rail1898 l_hwy1947 l_pix1835"
		capture drop l_vmt l_ln
		gen l_vmt = l_vmt_IH  
		gen l_ln  = l_ln_km_IH 



* Model 1 *	

		xi: ivregress 2sls l_vmt i.year (l_ln = l_rail1898 l_hwy1947 l_pix1835), robust      

		xi: genqreg l_vmt l_ln,  q(10) proneness(i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)        
		xi: genqreg l_vmt l_ln,  q(25) proneness(i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(50) proneness(i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(75) proneness(i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)   optimize(grid) grid1(0.1(0.01)2)  
		xi: genqreg l_vmt l_ln,  q(90) proneness(i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)      



* Model 2 *	

		xi: ivregress 2sls l_vmt l_pop i.year  (l_ln = l_rail1898 l_hwy1947 l_pix1835), robust      		

		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)      
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)   optimize(grid) grid1(0.1(0.01)2)    
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)   optimize(grid) grid1(0.01(0.02)2)    		      		



* Model 3 *	

		xi: ivregress 2sls l_vmt l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year  (l_ln = l_rail1898 l_hwy1947 l_pix1835), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     		      		       		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     		      	      		     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     		      		     		   
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     		      		    		
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     		          		     



* Model 4 *	

		xi: ivregress 2sls l_vmt l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln = l_rail1898 l_hwy1947 l_pix1835), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)    		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)        
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)      
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835)  optimize(grid) grid1(0.1(0.01)2)      
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)         		



* Model 5 *	

		xi: ivregress 2sls l_vmt l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln = l_rail1898 l_hwy1947 l_pix1835), robust       				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments(l_rail1898 l_hwy1947 l_pix1835) optimize(grid) grid1(0.1(0.01)2)	

		
		
	
	
	
* Second Panel *	
		
		local Inst "l_hwy1947"
		capture drop l_vmt l_ln
		gen l_vmt = l_vmt_IH  
		gen l_ln  = l_ln_km_IH 



* Model 1 *	

		xi: ivregress 2sls l_vmt i.year (l_ln =  l_hwy1947 ), robust      

		xi: genqreg l_vmt l_ln,  q(10) proneness(i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(25) proneness(i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)          
		xi: genqreg l_vmt l_ln,  q(50) proneness(i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)            
		xi: genqreg l_vmt l_ln,  q(75) proneness(i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)      



* Model 2 *	

		xi: ivregress 2sls l_vmt l_pop i.year  (l_ln =  l_hwy1947 ), robust      		

		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)    
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2) 


* Model 3 *	

		xi: ivregress 2sls l_vmt l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year  (l_ln =  l_hwy1947 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2) 
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 )   optimize(grid) grid1(0.1(0.01)2)   		     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)     		   
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)   		
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)     



* Model 4 *	

		xi: ivregress 2sls l_vmt l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_hwy1947 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)         
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)      



* Model 5 *	

		xi: ivregress 2sls l_vmt l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_hwy1947 ), robust       
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 )  optimize(grid) grid1(0.1(0.01)2)  
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_hwy1947 ) optimize(grid) grid1(0.1(0.01)2)	
	

	
	
* Third Panel *	
		
		local Inst "l_rail1898"
		capture drop l_vmt l_ln
		gen l_vmt = l_vmt_IH  
		gen l_ln  = l_ln_km_IH 



* Model 1 *	

		xi: ivregress 2sls l_vmt i.year (l_ln =  l_rail1898 ), robust      

		xi: genqreg l_vmt l_ln,  q(10) proneness(i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(25) proneness(i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)          
		xi: genqreg l_vmt l_ln,  q(50) proneness(i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)             
		xi: genqreg l_vmt l_ln,  q(75) proneness(i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)     



* Model 2 *	

		xi: ivregress 2sls l_vmt l_pop i.year  (l_ln =  l_rail1898 ), robust      		

		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)     		      		


* Model 3 *	

		xi: ivregress 2sls l_vmt l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year  (l_ln =  l_rail1898 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)     		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)     		     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)     		   
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.05)2)   		
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)   		     


* Model 4 *	

		xi: ivregress 2sls l_vmt l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_rail1898 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)    		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)         
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)        



* Model 5 *	

		xi: ivregress 2sls l_vmt l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_rail1898 ), robust      
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)   		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)    
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 )  optimize(grid) grid1(0.1(0.01)2)  
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_rail1898 ) optimize(grid) grid1(0.1(0.01)2)	
	

	
	
* Fourth Panel *	
		
		local Inst "l_pix1835"
		capture drop l_vmt l_ln
		gen l_vmt = l_vmt_IH  
		gen l_ln  = l_ln_km_IH 




* Model 1 *	

		xi: ivregress 2sls l_vmt i.year (l_ln =  l_pix1835 ), robust    

		xi: genqreg l_vmt l_ln,  q(10) proneness(i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)      
		xi: genqreg l_vmt l_ln,  q(25) proneness(i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)          
		xi: genqreg l_vmt l_ln,  q(50) proneness(i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)            
		xi: genqreg l_vmt l_ln,  q(75) proneness(i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)   
		xi: genqreg l_vmt l_ln,  q(90) proneness(i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)      



* Model 2 *	

		xi: ivregress 2sls l_vmt l_pop i.year  (l_ln =  l_pix1835 ), robust      		

		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)    
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)      	


* Model 3 *	

		xi: ivregress 2sls l_vmt l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year  (l_ln =  l_pix1835 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)	
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )   optimize(grid) grid1(0.1(0.01)2)   		     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)     		   
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )   optimize(grid) grid1(0.1(0.01)2)  		
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)   		     


* Model 4 *	

		xi: ivregress 2sls l_vmt l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_pix1835 ), robust      				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)    		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)         
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)       
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)         		



* Model 5 *	

		xi: ivregress 2sls l_vmt l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year (l_ln =  l_pix1835 ), robust       				
		
		xi: genqreg l_vmt l_ln,  q(10) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)   		
		xi: genqreg l_vmt l_ln,  q(25) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)     
		xi: genqreg l_vmt l_ln,  q(50) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )  optimize(grid) grid1(0.1(0.01)2)  
		xi: genqreg l_vmt l_ln,  q(75) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 )   optimize(grid) grid1(0.1(0.01)2) 
		xi: genqreg l_vmt l_ln,  q(90) proneness(l_pop l_pop80 l_pop70 l_pop60 l_pop50 l_pop40 l_pop30 l_pop20 S_somecollege l_mean_income S_poor S_manuf div2 div3 div4 div5 div6 div7 div8 div9 elevat_range_msa ruggedness_msa heating_dd cooling_dd sprawl i.year) instruments( l_pix1835 ) optimize(grid) grid1(0.1(0.01)2)	
	

		
	
log off 
